function [x] = SelectKRestos(k, size, pop)
global u p PRECISION;
        %devuelve k seleccionados por restos
         %x = zeros(k, PRECISION);
        j=1;
        %calculo los restos
        for i=1:size
           restos(i) = floor(p(i)*k);
           if restos(i) > 0
               for jj=0:restos(i)
                    x(j,:) = pop(i,:);
                    j=j+1;
               end
           end
           
        end
        
        
       
       if j == 1
           x(:,:) = SelectKRandom(k, size, pop);
           
       else if j < k
               y= SelectKRandom(k-j+1, size, pop);
               x = [x ;y];
           end
       end
       
       
        
        